home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / tex / tex31 / inputs.lzh / manmac.tex < prev    next >
Text File  |  1990-04-04  |  28KB  |  716 lines

  1. % Macros for The TeXbook
  2.  
  3. \catcode`@=11 % borrow the private macros of PLAIN (with care)
  4.  
  5. \font\tentex=cmtex10
  6.  
  7. \font\inchhigh=cminch
  8. \font\titlefont=cmssdc10 at 40pt
  9.  
  10. \font\ninerm=cmr9
  11. \font\eightrm=cmr8
  12. \font\sixrm=cmr6
  13.  
  14. \font\ninei=cmmi9
  15. \font\eighti=cmmi8
  16. \font\sixi=cmmi6
  17. \skewchar\ninei='177 \skewchar\eighti='177 \skewchar\sixi='177
  18.  
  19. \font\ninesy=cmsy9
  20. \font\eightsy=cmsy8
  21. \font\sixsy=cmsy6
  22. \skewchar\ninesy='60 \skewchar\eightsy='60 \skewchar\sixsy='60
  23.  
  24. \font\eightss=cmssq8
  25.  
  26. \font\eightssi=cmssqi8
  27.  
  28. \font\ninebf=cmbx9
  29. \font\eightbf=cmbx8
  30. \font\sixbf=cmbx6
  31.  
  32. \font\ninett=cmtt9
  33. \font\eighttt=cmtt8
  34.  
  35. \hyphenchar\tentt=-1 % inhibit hyphenation in typewriter type
  36. \hyphenchar\ninett=-1
  37. \hyphenchar\eighttt=-1
  38.  
  39. \font\ninesl=cmsl9
  40. \font\eightsl=cmsl8
  41.  
  42. \font\nineit=cmti9
  43. \font\eightit=cmti8
  44.  
  45. \font\tenu=cmu10 % unslanted text italic
  46. \font\magnifiedfiverm=cmr5 at 10pt
  47. \font\manual=manfnt % font used for the METAFONT logo, etc.
  48. \font\cmman=cmman % font used for miscellaneous Computer Modern variations
  49.  
  50. \newskip\ttglue
  51. \def\tenpoint{\def\rm{\fam0\tenrm}%
  52.   \textfont0=\tenrm \scriptfont0=\sevenrm \scriptscriptfont0=\fiverm
  53.   \textfont1=\teni \scriptfont1=\seveni \scriptscriptfont1=\fivei
  54.   \textfont2=\tensy \scriptfont2=\sevensy \scriptscriptfont2=\fivesy
  55.   \textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex
  56.   \def\it{\fam\itfam\tenit}%
  57.   \textfont\itfam=\tenit
  58.   \def\sl{\fam\slfam\tensl}%
  59.   \textfont\slfam=\tensl
  60.   \def\bf{\fam\bffam\tenbf}%
  61.   \textfont\bffam=\tenbf \scriptfont\bffam=\sevenbf
  62.    \scriptscriptfont\bffam=\fivebf
  63.   \def\tt{\fam\ttfam\tentt}%
  64.   \textfont\ttfam=\tentt
  65.   \tt \ttglue=.5em plus.25em minus.15em
  66.   \normalbaselineskip=12pt
  67.   \def\MF{{\manual META}\-{\manual FONT}}%
  68.   \let\sc=\eightrm
  69.   \let\big=\tenbig
  70.   \setbox\strutbox=\hbox{\vrule height8.5pt depth3.5pt width\z@}%
  71.   \normalbaselines\rm}
  72.  
  73. \def\ninepoint{\def\rm{\fam0\ninerm}%
  74.   \textfont0=\ninerm \scriptfont0=\sixrm \scriptscriptfont0=\fiverm
  75.   \textfont1=\ninei \scriptfont1=\sixi \scriptscriptfont1=\fivei
  76.   \textfont2=\ninesy \scriptfont2=\sixsy \scriptscriptfont2=\fivesy
  77.   \textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex
  78.   \def\it{\fam\itfam\nineit}%
  79.   \textfont\itfam=\nineit
  80.   \def\sl{\fam\slfam\ninesl}%
  81.   \textfont\slfam=\ninesl
  82.   \def\bf{\fam\bffam\ninebf}%
  83.   \textfont\bffam=\ninebf \scriptfont\bffam=\sixbf
  84.    \scriptscriptfont\bffam=\fivebf
  85.   \def\tt{\fam\ttfam\ninett}%
  86.   \textfont\ttfam=\ninett
  87.   \tt \ttglue=.5em plus.25em minus.15em
  88.   \normalbaselineskip=11pt
  89.   \def\MF{{\manual hijk}\-{\manual lmnj}}%
  90.   \let\sc=\sevenrm
  91.   \let\big=\ninebig
  92.   \setbox\strutbox=\hbox{\vrule height8pt depth3pt width\z@}%
  93.   \normalbaselines\rm}
  94.  
  95. \def\eightpoint{\def\rm{\fam0\eightrm}%
  96.   \textfont0=\eightrm \scriptfont0=\sixrm \scriptscriptfont0=\fiverm
  97.   \textfont1=\eighti \scriptfont1=\sixi \scriptscriptfont1=\fivei
  98.   \textfont2=\eightsy \scriptfont2=\sixsy \scriptscriptfont2=\fivesy
  99.   \textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex
  100.   \def\it{\fam\itfam\eightit}%
  101.   \textfont\itfam=\eightit
  102.   \def\sl{\fam\slfam\eightsl}%
  103.   \textfont\slfam=\eightsl
  104.   \def\bf{\fam\bffam\eightbf}%
  105.   \textfont\bffam=\eightbf \scriptfont\bffam=\sixbf
  106.    \scriptscriptfont\bffam=\fivebf
  107.   \def\tt{\fam\ttfam\eighttt}%
  108.   \textfont\ttfam=\eighttt
  109.   \tt \ttglue=.5em plus.25em minus.15em
  110.   \normalbaselineskip=9pt
  111.   \def\MF{{\manual opqr}\-{\manual stuq}}%
  112.   \let\sc=\sixrm
  113.   \let\big=\eightbig
  114.   \setbox\strutbox=\hbox{\vrule height7pt depth2pt width\z@}%
  115.   \normalbaselines\rm}
  116.  
  117. \def\tenmath{\tenpoint\fam-1 } % use after $ in ninepoint sections
  118. \def\tenbig#1{{\hbox{$\left#1\vbox to8.5pt{}\right.\n@space$}}}
  119. \def\ninebig#1{{\hbox{$\textfont0=\tenrm\textfont2=\tensy
  120.   \left#1\vbox to7.25pt{}\right.\n@space$}}}
  121. \def\eightbig#1{{\hbox{$\textfont0=\ninerm\textfont2=\ninesy
  122.   \left#1\vbox to6.5pt{}\right.\n@space$}}}
  123.  
  124. % Page layout
  125. \newdimen\pagewidth \newdimen\pageheight \newdimen\ruleht
  126. \hsize=29pc  \vsize=44pc  \maxdepth=2.2pt  \parindent=3pc
  127. \pagewidth=\hsize \pageheight=\vsize \ruleht=.5pt
  128. \abovedisplayskip=6pt plus 3pt minus 1pt
  129. \belowdisplayskip=6pt plus 3pt minus 1pt
  130. \abovedisplayshortskip=0pt plus 3pt
  131. \belowdisplayshortskip=4pt plus 3pt
  132.  
  133. %\newinsert\footins
  134. \def\footnote#1{\edef\@sf{\spacefactor\the\spacefactor}#1\@sf
  135.       \insert\footins\bgroup\eightpoint
  136.       \interlinepenalty100 \let\par=\endgraf
  137.         \leftskip=\z@skip \rightskip=\z@skip
  138.         \splittopskip=10pt plus 1pt minus 1pt \floatingpenalty=20000
  139.         \smallskip\item{#1}\bgroup\strut\aftergroup\@foot\let\next}
  140. \skip\footins=12pt plus 2pt minus 4pt % space added when footnote is present
  141. %\count\footins=1000 % footnote magnification factor (1 to 1)
  142. \dimen\footins=30pc % maximum footnotes per page
  143.  
  144. \newinsert\margin
  145. \dimen\margin=\maxdimen
  146. %\count\margin=0 \skip\margin=0pt % marginal inserts take up no space
  147.  
  148. \newif\iftitle
  149. \def\titlepage{\global\titletrue} % for pages without headlines
  150. \def\rhead{} % \rhead contains the running headline
  151.  
  152. \def\leftheadline{\hbox to \pagewidth{%
  153.     \vbox to 10pt{}% strut to position the baseline
  154.     \llap{\tenbf\folio\kern1pc}% folio to left of text
  155.     \tenit\rhead\hfil% running head flush left
  156.     }}
  157. \def\rightheadline{\hbox to \pagewidth{%
  158.     \vbox to 10pt{}% strut to position the baseline
  159.     \hfil\tenit\rhead\/% running head flush right
  160.     \rlap{\kern1pc\tenbf\folio}% folio to right of text
  161.     }}
  162.  
  163. \def\onepageout#1{\shipout\vbox{ % here we define one page of output
  164.     \offinterlineskip % butt the boxes together
  165.     \vbox to 3pc{ % this part goes on top of the 44pc pages
  166.       \iftitle % the next is used for title pages
  167.         \global\titlefalse % reset the titlepage switch
  168.         \setcornerrules % for camera alignment
  169.       \else\ifodd\pageno \rightheadline\else\leftheadline\fi\fi
  170.       \vfill} % this completes the \vbox to 3pc
  171.     \vbox to \pageheight{
  172.       \ifvoid\margin\else % marginal info is present
  173.         \rlap{\kern31pc\vbox to\z@{\kern4pt\box\margin \vss}}\fi
  174.       #1 % now insert the main information
  175.       \ifvoid\footins\else % footnote info is present
  176.         \vskip\skip\footins \kern-3pt
  177.         \hrule height\ruleht width\pagewidth \kern-\ruleht \kern3pt
  178.         \unvbox\footins\fi
  179.       \boxmaxdepth=\maxdepth
  180.       } % this completes the \vbox to \pageheight
  181.     }
  182.   \advancepageno}
  183.  
  184. \def\setcornerrules{\hbox to \pagewidth{\vrule width 1pc height\ruleht
  185.     \hfil \vrule width 1pc}
  186.   \hbox to \pagewidth{\llap{\sevenrm(page \folio)\kern1pc}%
  187.     \vrule height1pc width\ruleht depth\z@
  188.     \hfil \vrule width\ruleht depth\z@}}
  189.  
  190. \output{\onepageout{\unvbox255}}
  191.  
  192. \newbox\partialpage
  193. \def\begindoublecolumns{\begingroup
  194.   \output={\global\setbox\partialpage=\vbox{\unvbox255\bigskip}}\eject
  195.   \output={\doublecolumnout} \hsize=14pc \vsize=89pc}
  196. \def\enddoublecolumns{\output={\balancecolumns}\eject
  197.   \endgroup \pagegoal=\vsize}
  198.  
  199. \def\doublecolumnout{\splittopskip=\topskip \splitmaxdepth=\maxdepth
  200.   \dimen@=44pc \advance\dimen@ by-\ht\partialpage
  201.   \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
  202.   \onepageout\pagesofar
  203.   \unvbox255 \penalty\outputpenalty}
  204. \def\pagesofar{\unvbox\partialpage
  205.   \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}}
  206. \def\balancecolumns{\setbox0=\vbox{\unvbox255} \dimen@=\ht0
  207.   \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip
  208.   \divide\dimen@ by2 \splittopskip=\topskip
  209.   {\vbadness=10000 \loop \global\setbox3=\copy0
  210.     \global\setbox1=\vsplit3 to\dimen@
  211.     \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat}
  212.   \setbox0=\vbox to\dimen@{\unvbox1}
  213.   \setbox2=\vbox to\dimen@{\unvbox3}
  214.   \pagesofar}
  215.  
  216. % To produce only a subset of pages, put the page numbers on separate
  217. % lines in a file called pages.tex
  218. \let\Shipout=\shipout
  219. \newread\pages \newcount\nextpage \openin\pages=pages
  220. \def\getnextpage{\ifeof\pages\else
  221.  {\endlinechar=-1\read\pages to\next
  222.   \ifx\next\empty % in this case we should have eof now
  223.   \else\global\nextpage=\next\fi}\fi}
  224. \ifeof\pages\else\message{OK, I'll ship only the requested pages!}
  225.  \getnextpage\fi
  226. \def\shipout{\ifeof\pages\let\next=\Shipout
  227.  \else\ifnum\pageno=\nextpage\getnextpage\let\next=\Shipout
  228.   \else\let\next=\Tosspage\fi\fi \next}
  229. \newbox\garbage \def\Tosspage{\deadcycles